package com.gf.exam.service;

import java.util.List;
import java.util.Map;

import com.gf.common.bean.Page;
import com.gf.exam.model.Answer;
import com.gf.exam.model.AnswerCell;

public interface AnswerService {

	/**
	 * * 用户提交答案<br>
	 * 批量保存<br>
	 * 
	 * @param userId
	 * @param username
	 * @param examId
	 * @param cellNo
	 * @param answerRight
	 * @param mouseAction
	 * @param inputAction
	 * @param rt
	 * @return answerId 不成功返回 0
	 */
	public long save(long userId, String username, long examId, int cellNo,
			String[] answerRight, String[] mouseAction, String[] inputAction,
			String[] rt);

	/**
	 * 浏览该项目的答案
	 * 
	 * @param userId
	 * @param examId
	 * @return
	 */
	public Answer scanById(long id);


	/**
	 * 得到该测试项目下的所有问卷
	 * 
	 * @param examId
	 * @param curpage
	 * @param pageSize
	 * @return
	 */
	public Page getAllAnswer(long examId, int curpage, int pageSize);

	
	/**
	 * 某用户的答卷详情
	 * @param answerId
	 * @return
	 */
	public List<AnswerCell> getAnswerCells(long answerId);
	/**
	 * 得到答题总数
	 * @return
	 */
	public int getTotalCount();
	
	/**
	 * 得到该项目下所有的答案
	 * @param examId
	 * @return Long answerId<br>
	 * List 对应的下的所有answercell
	 */
	public Map<Long, List<AnswerCell>> getAllAnsewerByExamId(long examId);
}
